package com.lyrcsoft;


import com.lyrcsoft.config.AppConfig;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class App {

	public static void main(String[] args) {


		AnnotationConfigApplicationContext ac = new AnnotationConfigApplicationContext();
		// 动态注册一个配置类，当然也可以不是配置类
		ac.register(AppConfig.class);

		//RootBeanDefinition rootBeanDefinition = new RootBeanDefinition();
		//rootBeanDefinition.setBeanClass(ParentObj.class);
		//rootBeanDefinition.getPropertyValues().add("type", "电影");
		//rootBeanDefinition.getPropertyValues().add("name", "大话西游");
		//ac.registerBeanDefinition("root", rootBeanDefinition);
		//
		//GenericBeanDefinition genericBeanDefinition = new GenericBeanDefinition();
		//genericBeanDefinition.setBeanClass(ChildObj.class);
		//genericBeanDefinition.setParentName("root");
		//genericBeanDefinition.getPropertyValues().add("name", "少林足球");
		//ac.registerBeanDefinition("child", genericBeanDefinition);

		//  调用refresh
		// 更新、刷新动作
		ac.refresh();

		//System.out.println(ac.getBean("child"));

		System.out.println(ac.getBean("b"));
	}
}
